package com.ljb.utilslibary_master.utils;

import android.os.Environment;
import android.text.TextUtils;

import java.io.File;

/**
 * Created by bin on 2017/6/24.
 */

public class SDCardUtils {
    private SDCardUtils() {
    }

    /**
     * 判断SD卡是否可用
     *
     * @return true表示可用, false表示不可用
     */
    public static boolean isSDCardEnable() {
        return TextUtils.equals(Environment.getExternalStorageState(), Environment.MEDIA_MOUNTED);
    }

    /**
     * 获取SD卡的绝对路径
     *
     * @return 路径
     */
    public static String getSDCardPath() {
        return Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator;
    }

}
